﻿#include "controller.h"

#include <QDebug>

#include "command.h"

enum _Command {
    OpenCmd = 0,
    CloseCmd = 1
};

Controller::Controller()
{

}

void Controller::close()
{
    qDebug() << "controller close tv";
    m_commandMap[CloseCmd]->execute();
}

void Controller::open()
{
    qDebug() << "controller open tv";
    m_commandMap[OpenCmd]->execute();
}

void Controller::setOpenCommand(Command *openCmd)
{
    m_commandMap.insert(OpenCmd, openCmd);
}

void Controller::setCloseCommand(Command *closeCmd)
{
    m_commandMap.insert(CloseCmd, closeCmd);
}
